package com.hxut.mrs.controller;

import com.hxut.mrs.common.ResponseResult;
import com.hxut.mrs.domain.User;
import com.hxut.mrs.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * description: LoginController
 * date: 2022/7/8 8:28
 * author: MR.孙
 */
@RestController
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/user/login")
    public ResponseResult login(@RequestBody User user){
        return loginService.login(user);
    }

    @GetMapping("/user/logout")
    public ResponseResult logout(){
        return loginService.logout();
    }

    @PostMapping("/testCors")
    public ResponseResult testCors(){
        return new ResponseResult(200,"testCors",null);
    }
}
